package com.guli.edu.controller;

import com.guli.utils.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

@Api(description = "登录管理")  // swagger用
//@CrossOrigin        // 跨域
@RequestMapping("/edu/user")    // nginx请求转发时以edu为入口 请求前面需要加上edu 才能访问该服务
@RestController
public class LoginController {

    @PostMapping("/login")
    public R login(){
        return R.ok().data("token", "admin");
    }

    @GetMapping("/info")
    public R info(){
        return R.ok().data("roles", "[admin]").data("name", "admin").data("avatar","https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202005%2F02%2F20200502185802_FuFU2.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666424981&t=b259c5ca87f4af3bee71ec4840e55922");
    }

}
